#include <iostream>
using namespace std;
const int maxn = 999999;
int nums[maxn], s;
void change(int n, int b);
bool isPalindromic();
int main()
{
    int n,b;
    cin >> n >> b;
    change(n,b);
    cout << (isPalindromic() ? "Yes" : "No") << endl;
    for(int i = s - 1; i >= 0; -- i)
    {
        if(i == s - 1)
            cout << nums[i];
        else
            cout << " " << nums[i];
    }
}
void change(int n, int b)
{
    int i = 0;
    while (n)
    {
        nums[i++] = n % b;
        n /= b;
    }
    s = i;
}
bool isPalindromic()
{
    if (s == 1)
        return true;
    else
    {
        for (int i = 0; i < s / 2; i++)
        {
            if(nums[i] != nums[s - i - 1])
                return false;
        }
        return true;
    }
}